let fs = require('fs')
let str = '';
for (let i = 0; i < 500; i++) {
    str += `${i}: 今日星期${i}\n`

}
let witeStream = fs.createWriteStream('./witeData.txt')
// 写入的数据
witeStream.write(str)
witeStream.end()//  结束时  
// 写入的回调  不能少写 witeStream.end()
witeStream.on('finish', () => {
    console.log('写入成功');
})